<#include "/common/include.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="testM列表">
</@header>
<@search fromId="testM-form">
<div class="select-list">
    <ul>
           <li>
              <label> <@ctx.i18n text = "name"/>：
               <input type="text" placeholder="LIKE" name="name"/> </label>
            </li>
          <li class="select-time">
             <label> <@ctx.i18n text = "brithday"/>： </label>
            <input type="text" class="time-input" placeholder="" name="Brithday"/>
        </li>
        <li>
          <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;<@ctx.i18n text = "查询"/></a>
          <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>
       </li>
    </ul>
</div>
</@search>
<@table tableId="bootstrap-table">
    <@shiro.hasPermission name="gen:testM:add">
                    <a class="btn btn-success" onclick="opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="gen:testM:edit">
        <a class="btn btn-primary single disabled" onclick="opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="gen:testM:del">
        <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()">
            <i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/>
        </a>
    </@shiro.hasPermission>

</@table>
<@footer>
<script>
    var editFlag = "${permission.hasPermi("gen:testM:edit")}";
    var listFlag = "${permission.hasPermi("gen:testM:add")}";
    var delFlag = "${permission.hasPermi("gen:testM:del")}";
    var visible = ${permission.isPermitteds("gen:testM:edit,gen:testM:del,gen:testM:add")?string('true', 'false')};
    var prefix = baseURL + "gen/testM";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            modalName: "testM",
            uniqueId:    'id'/* 唯一ID */                   ,
            escape: true,            /* 分页设置 */
            showPageGo: true,       /* 分页设置 */
            pageSize: 10,            /* 分页设置 */
            pageList: [10, 30, 50], /* 分页设置 */
            columns: [
                {title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                            return $.table.serialNumber(index);
                }}
                ,{field : 'id',title : '<@ctx.i18n text = "id"/>',visible: false}
              ,{field : 'name',title : '<@ctx.i18n text = "name"/>', align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'brithday',title : '<@ctx.i18n text = "brithday"/>',sortable: true, align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
              ,{field : 'createTime',title : '<@ctx.i18n text = "createTime"/>',sortable: true, align: 'center', formatter: function(value, row, index) {return $.table.tooltip(value,10);}}
               ,{title:"<@ctx.i18n text = "操作"/>",align: 'center',visible:visible,class:'action',formatter: function(value, row, index) {
                        var actions = [];
                          actions.push('<a class="' + editFlag + '" href="javascript:void(0)" title="<@ctx.i18n text = "编辑"/>" onclick="opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i></a> ');
                        actions.push('<a class="' + delFlag + '" href="javascript:void(0)" title="<@ctx.i18n text = "删除"/>" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></a> ');
                         return actions.join('');
                    }
                }

                ]
            };
            $.table.init(options);
        });

</script>
</@footer>
</@pageTheme>